package info.hexin.json.serialize.render;

import info.hexin.json.JsonConfig;
import info.hexin.json.serialize.JsonRender;
import info.hexin.json.serialize.StringWrite;

import java.util.Date;

public class DateRender implements JsonRender {
    public static DateRender instance = new DateRender();

    @Override
    public void render(Object object, StringWrite write) {
        Date date = (Date) object;
        String time = JsonConfig.sdf.format(date);
        write.appendFiledNameWithQuotation(time);
    }
}
